package run.halo.app.plugins.elastic.properties;

import java.util.List;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "elastic", ignoreInvalidFields=true)
@Data
public class ElasticsearchProperties {

    /** 是否启用 */
    private boolean enable;

    /** 地址 */
    private List<String> hosts;

    /** 认证校验 */
    private boolean authEnable;
    private String username;
    private String password;

    /** 是否启动嗅探器 */
    private boolean sniffEnable;
    /** 嗅探器执行时间 */
    private Integer sniffIntervalMillis = 5000;
    /** 嗅探器错误重试执行时间 */
    private Integer sniffAfterFailureDelayMillis = 15000;

}
